package com.michael.study.arouter.intercept;

import android.content.Context;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;
import com.michael.study.arouter.RoutePath;

/**
 * Description:
 *
 * <p>Created by liuguoquan on 2020/8/5 11:06.
 */
@Interceptor(priority = 0)
public class TestInterceptor implements IInterceptor {

    Context mContext;

    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        if (postcard.getPath().equals(RoutePath.TEST_ACTIVITY_1)) {
            postcard.withString("name","zhangxiaoyu");
        }
        callback.onContinue(postcard);

    }

    @Override
    public void init(Context context) {
        this.mContext = context;
    }
}
